#!/usr/bin/env python
# -*-coding: utf-8-*-

import socket
addr = ('192.168.199.131', 8089)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(addr)

s.listen(5)

while True:
    conn, addr = s.accept()
    print(conn, addr)
    while True:
        try:
            data = conn.recv(1024)
            print('receive: ', data.decode())
            conn.send(data.upper())
        except Exception as e:
            print(e)
            break
    
    conn.close()


